<?php
/**
 * Created by PhpStorm.
 * User: kalv1n
 * Date: 2017/1/6
 * Time: 下午6:46
 */
namespace App;

use Illuminate\Database\Eloquent\Model;

class Student extends Model
{
    // 指定表名
    protected $table='student';

    // 指定id
    protected $primaryKey='id';
    //增加允许批量添加的字段列表
    protected $fillable=['name','age'];
    //指定某个字段不允许批量赋值
    protected $guarded=[];
    //设置时间不自动关联
    public $timestamps=true;

    protected function getDateFormat()
    {
        // TODO: Change the autogenerated stub
        // eturn parent::getDateFormat();
        return time();
    }
    protected function asDateTime($val){
            return $val;
    }
}